package com.weigang.log.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class HelloController {


    @GetMapping("/hello")
    public String hello() {
        log.info("----------日志测试--------------");
        try {
            System.out.println(1/0);
        }catch (Exception e){
            //记录错误日志
            log.error(e.getMessage());
        }
        return "Hello World!";
    }

}
